package com.malphite.mongodemo.mongo;

import com.mongodb.client.MongoCollection;
import com.mongodb.client.MongoDatabase;
import com.mongodb.client.model.Indexes;
import org.bson.Document;
import org.bson.conversions.Bson;

public class Mongo4Index {

    public static void main(String[] args) {

        Bson ascending = Indexes.ascending("");
        Bson descending = Indexes.descending("");
        Bson bson = Indexes.compoundIndex(Indexes.ascending(""), Indexes.ascending(""));
        Bson geo2d = Indexes.geo2d("");
        Bson geo2dsphere = Indexes.geo2dsphere("");
        Bson hashed = Indexes.hashed("");
        Bson text = Indexes.text("");
        MongoDatabase dataBase = Mongo1Connection.getDataBase("");
        MongoCollection<Document> collection = dataBase.getCollection("");
        collection.createIndex(text);

    }


}
